//
//  YDSingleStockIntroductionModel.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2018/1/9.
//  Copyright © 2018年 LK-IOS. All rights reserved.
//

#import "YDSingleStockIntroductionModel.h"

@implementation YDSingleStockIntroductionModel

-(NSString *)gsmcString
{
    return @"公司名称";
}
-(NSString *)companyNameString
{
    if (_companyName.length) {
        return [_companyName stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}
-(NSString *)zczbString
{
    return @"注册资本";
}
-(NSString *)zhucezibenString
{
    if (_zhuceziben.length) {
        return [_zhuceziben stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}
-(NSString *)sssjString
{
    return @"上市时间";
}
-(NSString *)shangshiriqiString
{
    if (_shangshiriqi.length) {
        return [_shangshiriqi stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}
-(NSString *)fxjgString
{
    return @"发行价格";
}
-(NSString *)faxingjiageString
{
    if (_faxingjiage.length) {
        return [_faxingjiage stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}

-(NSString *)gsdzString
{
    return @"公司地址";
}
-(NSString *)bangongdizhiString
{
    if (_bangongdizhi.length) {
        return [_bangongdizhi stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}
-(NSString *)gsjjString
{
    return @"公司简介";
}
-(NSString *)gongsijianjieString
{
    if (_gongsijianjie.length) {
        return [_gongsijianjie stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}
-(NSString *)jyfwString
{
    return @"经营范围";
}
-(NSString *)jingyingfanweiString
{
    if (_jingyingfanwei.length) {
        return [_jingyingfanwei stringByReplacingOccurrencesOfString:@" " withString:@""];
    }else{
        return @"---";
    }
}

-(CGFloat)cellH
{
    //左右间距
    CGFloat marginL = rate375(20);
    //上下间距
    CGFloat marginT;
    if (isPhoneX) {
        marginT = rateX812(20);
    }else{
        marginT = rate750(20);
    }
    //类别宽度
    CGFloat cateWidth = (LKScreenW - marginL * 3) * 0.25;
    //内容宽度
    CGFloat contentWidth = cateWidth * 3;
    
    //公司名称
    CGFloat companyNameX = cateWidth + marginL * 2;
    CGFloat companyNameY = marginT;
    CGFloat companyNameW = cateWidth * 3;
    CGFloat companyNameH = [NSString getWrapSpaceLabelHeight:self.companyNameString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    
    _companyNameFrame = CGRectMake(companyNameX, companyNameY, companyNameW, companyNameH);
    
    
    CGFloat gsmcX = marginL;
    CGFloat gsmcW = cateWidth;
    CGFloat gsmcH = [NSString getWrapSpaceLabelHeight:[NSString stringWithFormat:@"%@" ,self.gsmcString] withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    CGFloat gsmcY = CGRectGetMinY(_companyNameFrame) + companyNameH * 0.5 - gsmcH * 0.5;
    _gsmcStringFrame = CGRectMake(gsmcX, gsmcY, gsmcW, gsmcH);
    
    
    //注册资本
    CGFloat zhucezibenX = cateWidth + marginL * 2;
    CGFloat zhucezibenY = CGRectGetMaxY(_companyNameFrame) + marginT;
    CGFloat zhucezibenW = cateWidth * 3;
    CGFloat zhucezibenH = [NSString getWrapSpaceLabelHeight:self.zhucezibenString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    _zhucezibenFrame = CGRectMake(zhucezibenX, zhucezibenY, zhucezibenW, zhucezibenH);
    
    
    CGFloat zczbX = marginL;
    CGFloat zczbW = cateWidth;
    CGFloat zczbH = gsmcH;
    CGFloat zczbY = CGRectGetMinY(_zhucezibenFrame) + zhucezibenH * 0.5 - zczbH * 0.5;
    _zczbStringFrame = CGRectMake(zczbX, zczbY, zczbW, zczbH);
    
    
    //上市时间
    CGFloat shangshiriqiX = cateWidth + marginL * 2;
    CGFloat shangshiriqiY = CGRectGetMaxY(_zhucezibenFrame) + marginT;
    CGFloat shangshiriqiW = cateWidth * 3;
    CGFloat shangshiriqiH = [NSString getWrapSpaceLabelHeight:self.shangshiriqiString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    _shangshiriqiFrame = CGRectMake(shangshiriqiX, shangshiriqiY, shangshiriqiW, shangshiriqiH);
    
    
    CGFloat sssjX = marginL;
    CGFloat sssjW = cateWidth;
    CGFloat sssjH = gsmcH;
    CGFloat sssjY = CGRectGetMinY(_shangshiriqiFrame) + shangshiriqiH * 0.5 - sssjH * 0.5;
    _sssjStringFrame = CGRectMake(sssjX, sssjY, sssjW, sssjH);
    
    
    
    //发行价格
    CGFloat faxingjiageX = cateWidth + marginL * 2;
    CGFloat faxingjiageY = CGRectGetMaxY(_shangshiriqiFrame) + marginT;
    CGFloat faxingjiageW = cateWidth * 3;
    CGFloat faxingjiageH = [NSString getWrapSpaceLabelHeight:self.faxingjiageString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    _faxingjiageFrame = CGRectMake(faxingjiageX, faxingjiageY, faxingjiageW, faxingjiageH);
    
    
    CGFloat fxjgX = marginL;
    CGFloat fxjgW = cateWidth;
    CGFloat fxjgH = gsmcH;
    CGFloat fxjgY = CGRectGetMinY(_faxingjiageFrame) + faxingjiageH * 0.5 - fxjgH * 0.5;
    _fxjgStringFrame = CGRectMake(fxjgX, fxjgY, fxjgW, fxjgH);
    
    
    //公司地址
    CGFloat bangongdizhiX = cateWidth + marginL * 2;
    CGFloat bangongdizhiY = CGRectGetMaxY(_faxingjiageFrame) + marginT;
    CGFloat bangongdizhiW = cateWidth * 3;
    CGFloat bangongdizhiH = [NSString getWrapSpaceLabelHeight:self.bangongdizhiString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    _bangongdizhiFrame = CGRectMake(bangongdizhiX, bangongdizhiY, bangongdizhiW, bangongdizhiH);
    
    
    CGFloat gsdzX = marginL;
    CGFloat gsdzW = cateWidth;
    CGFloat gsdzH = gsmcH;
    CGFloat gsdzY = CGRectGetMinY(_bangongdizhiFrame) + bangongdizhiH * 0.5 - gsdzH * 0.5;
    _gsdzStringFrame = CGRectMake(gsdzX, gsdzY, gsdzW, gsdzH);
    
    
    //公司简介
    CGFloat gongsijianjieX = cateWidth + marginL * 2;
    CGFloat gongsijianjieY = CGRectGetMaxY(_bangongdizhiFrame) + marginT;
    CGFloat gongsijianjieW = cateWidth * 3;
    CGFloat gongsijianjieH = [NSString getWrapSpaceLabelHeight:self.gongsijianjieString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    _gongsijianjieFrame = CGRectMake(gongsijianjieX, gongsijianjieY, gongsijianjieW, gongsijianjieH);
    
    
    CGFloat gsjjX = marginL;
    CGFloat gsjjW = cateWidth;
    CGFloat gsjjH = gsmcH;
    CGFloat gsjjY = CGRectGetMinY(_gongsijianjieFrame) + gongsijianjieH * 0.5 - gsjjH * 0.5;
    _gsjjStringFrame = CGRectMake(gsjjX, gsjjY, gsjjW, gsjjH);
    
    
    //经营范围
    CGFloat jingyingfanweiX = cateWidth + marginL * 2;
    CGFloat jingyingfanweiY = CGRectGetMaxY(_gongsijianjieFrame) + marginT;
    CGFloat jingyingfanweiW = cateWidth * 3;
    CGFloat jingyingfanweiH = [NSString getWrapSpaceLabelHeight:self.jingyingfanweiString withFont:[UIFont systemFontOfSize:font12ScreenWRate * LKScreenW] withWidth:contentWidth andWrapSpace:0.5 withSpace:1.0];
    _jingyingfanweiFrame = CGRectMake(jingyingfanweiX, jingyingfanweiY, jingyingfanweiW, jingyingfanweiH);
    
    
    CGFloat jyfwX = marginL;
    CGFloat jyfwW = cateWidth;
    CGFloat jyfwH = gsmcH;
    CGFloat jyfwY = CGRectGetMinY(_jingyingfanweiFrame) + jingyingfanweiH * 0.5 - jyfwH * 0.5;
    _jyfwStringFrame = CGRectMake(jyfwX, jyfwY, jyfwW, jyfwH);
    
    
    
    return CGRectGetMaxY(_jingyingfanweiFrame) + marginT;
    
}





@end
